var obj={
    name:'小叶森森',
    age:34,
    info:{
        hobby:['travel','piano',{
            a:1
        }],
        career:{
            teacher:4,
            engineer:9
        }
    }
}

function deepClone(obj) {
    var result = Array.isArray(obj) ? [] : {};
    for (var key in obj) {
      if (obj.hasOwnProperty(key)) {
        if (typeof obj[key] === "object" && obj[key] !== null) {
          result[key] = deepClone(obj[key]); //递归复制
        } else {
          result[key] = obj[key];
        }
      }
    }
    return result;
  }
  


const newObj=deepClone(obj)
newObj.info.hobby[2].a=123
console.log(obj,newObj)